#include "XStringHelpers.h"


namespace Xts
{

	namespace Util
	{

		void Split( const std::string& str, std::vector<std::string>& elems, const std::string& delimiters /*= " "*/ )
		{
			// Skip delimiters at beginning.
			std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
			// Find first "non-delimiter".
			std::string::size_type pos     = str.find_first_of(delimiters, lastPos);

			while (std::string::npos != pos || std::string::npos != lastPos)
			{
				// Found a token, add it to the vector.
				elems.push_back(str.substr(lastPos, pos - lastPos));
				// Skip delimiters.  Note the "not_of"
				lastPos = str.find_first_not_of(delimiters, pos);
				// Find next "non-delimiter"
				pos = str.find_first_of(delimiters, lastPos);
			}
		}

		std::vector<std::string> Split(const std::string& str, const std::string& delimiters /*= " "*/ )
		{
			std::vector<std::string> elems;
			Split(str, elems, delimiters);
			return elems;
		}

		//int Stoi( const std::string& str, std::size_t* pos /*= 0*/, int base /*= 10 */ )
		//{
		//	return std::stoi(str, pos, base); //C++11
		//}

		//long Stol( const std::string& str, std::size_t* pos /*= 0*/, int base /*= 10 */ )
		//{
		//	return std::stol(str, pos, base); //C++11
		//}

		//long long Stoll( const std::string& str, std::size_t* pos /*= 0*/, int base /*= 10 */ )
		//{
		//	return std::stoll(str, pos, base); //C++11
		//}

		//float Stof( const std::string& str, std::size_t* pos /*= 0 */ )
		//{
		//	return std::stof(str, pos); //C++11
		//}

		//double Stod( const std::string& str, std::size_t* pos /*= 0 */ )
		//{
		//	return std::stod(str, pos); //C++11
		//}

	


	}

}